home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Loadstar 42
/
042.d81
/
file verifier
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
2022-08-26
|
3KB
|
111 lines
1 clr:dim f$(150),ft(150),fs(150)
5 poke53280,12:poke53281,12
8 print"[147][144] [146]";
9 print" loadstar presents [146]";
10 print" [146]";
11 print" file verifier [146]";
12 print" [146]";
13 print" by shawn ort (c)1986 [146]";
14 print" [146]";
15 print"notes:":print"+ = normal used track and sector"
16 print"+[144] = two or more files use the same block";
17 print"*[144] = disk error in file"
18 print" insert disk with files to"
19 print" verify and press space to continue"
20 print" press return to exit to loadstar"
21 print" hold down q to quit verifying"
22 geta$:ifa$=""then22
23 ifa$=chr$(13) then 30
25 ifa$=" "then 100
26 goto22
30 print"[145] do you wish to quit? (y/n) "
31 geta$:ifa$=""then31
32 ifa$="[217]"ora$="y"then40
33 ifa$="n"ora$="[206]"thenprint"[145][145]";:goto20
34 goto 31
40 open15,8,15,"r0:hello connect=hello connect":input#15,er:close15
41 ifer<>63 then print"[147]":end
45 load"hello connect",8,1
100 :
102 print"reading the directory..."
103 print"please wait..."
105 open15,8,15,"i0":close15
110 open1,8,2,"$"
115 forx=1to250:get#1,a$:nextx
120 x=0
125 :
130 get#1,a$:a$=a$+chr$(0):ifasc(a$)=0then130
135 tf=asc(a$):tf=tf-128:if tf>4thenclose1:goto200
140 get#1,a$:a$=a$+chr$(0):t=asc(a$)
145 get#1,a$:a$=a$+chr$(0):s=asc(a$)
150 ft(x)=t:fs(x)=s:ff$=""
155 get#1,a$:a$=a$+chr$(0):ifa$<>chr$(0)thenff$=ff$+a$:goto155
160 f$(x)=ff$
165 forxx=0to8:get#1,a$:nextxx
170 x=x+1:goto130
200 :
205 gosub1000
210 forf=0tox-1
214 poke781,0:sys59903
215 print"file to verify: ";f$(f)
216 print"blocks used: ";b;" [q[144]]uit";
220 open15,8,15:open5,8,5,"#"
225 print#15,"u1:"5;0;ft(f);fs(f)
230 get#5,t$:t=asc(t$+chr$(0))
235 get#5,s$:s=asc(s$+chr$(0))
237 if t=0thent=ft(f):s=fs(f):gosub2000:goto280
238 tt=t:ss=s:t=ft(f):s=fs(f):gosub2000
239 t=tt:s=ss
240 goto 265
245 :
250 print#15,"u1:"5;0;t;s
251 ifpeek(203)=62thenf=x-1:goto280
252 tt=t:ss=s
255 get#5,t$:t=asc(t$+chr$(0))
260 get#5,s$:s=asc(s$+chr$(0))
265 input#15,a$:ifa$<>"00"then er=255:t=tt:s=ss:gosub2000:goto 280
270 if t=0 then goto 280
271 ift>35ors>20then er=255:t=tt:s=ss:gosub2000:goto 280
272 gosub2000
275 goto250
280 close5:close15:next f
285 poke781,0:sys59903
288 print"blocks used: ";b
290 print"done, press any key when ready."
295 geta$:ifa$=""then295
300 run
1000 print"[147]20 ::::::::::::::::::"
1001 print"19 ::::::::::::::::::"
1002 print"18 :::::::::::"
1003 print"17 :::::"
1004 print"16"
1005 print"15"
1006 print"14"
1007 print"13"
1008 print"12"
1009 print"11"
1010 print"10"
1011 print" 9"
1012 print" 8"
1013 print" 7"
1014 print" 6"
1015 print" 5"
1016 print" 4"
1017 print" 3"
1018 print" 2"
1019 print" 1"
1020 print" 0"
1021 print" 00000000011111111112222222222333333"
1022 print" 12345678901234567890123456789012345[144]";
1025 return
2000 :
2001 input#15,a$
2002 if t>35 or s>20 then poke53280,6:for rt=1to20:nextrt:poke53280,12:return
2003 b=b+1:a=43:c=0
2004 ifer=255thener=0:a=42:c=1:goto2005
2005 p=peek(1905+t+(s*-40))
2006 if p=42 or p=43 thena=43:c=1
2007 poke1905+t+(s*-40),a
2008 poke56177+t+(s*-40),c
2010 return